
const jsonWrite = (res, ret) => {
    if (typeof ret === 'undefined') {
        res.json({
            code: '1',
            msg: '操作失败',
            data: null
        });
    } else {
        res.json({
            code: '0',
            msg: '成功',
            data: ret
        });
    }
}

exports.jsonWrite = jsonWrite;